package old.day06;

public class Day06Exercise {
    public static void main(String[] args) {
        int[] arr={20,50,40,52,60};
        int bb=getmax(arr);
        System.out.println(bb);
        int[] aa=generate(6,50);
        for (int i = 0; i < aa.length; i++) {
            System.out.println(aa[i]);
        }

    }
    public static int[] generate(int leng,int max){
        int[] arr=new int[leng];
        for (int i = 0; i <arr.length ; i++) {
           arr[i]=(int) (Math.random()*(max+1)) ;
        }
        return arr;
    }
    public static int getmax(int[] arr){
        int max=arr[0];
        for (int i=1;i<arr.length;i++){
            if (arr[i]>max){
                max=arr[i];
            }
        }
        return max;
    }
}
